<html>
    <head>
        <#include "/${system}/component/html-head.ftl" />
        <link rel="stylesheet" href="${base}/${system}/editor.md/css/editormd.min.css" />
    </head>
    <body>
        <#include "/${system}/component/head.ftl" />
        <div class="admin">
            <div class="aleft" id="left-container"></div>
            <div class="aright">
                <fieldset class="layui-elem-field layui-field-title" style="margin: 20px 30px 20px 20px;">
                    <legend>添加文章</legend>
                </fieldset>
                <form class="layui-form bform" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item" style="width: 300px;">
                        <label class="layui-form-label">所属分类</label>
                        <div class="layui-input-block" id="category"></div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章作者</label>
                        <div class="layui-input-block">
                            <input type="text" name="author" required lay-verify="required"  placeholder="请输入内容" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <!--<div class="layui-form-item">
                        <label class="layui-form-label">文章来源</label>
                        <div class="layui-input-block">
                            <input type="text" name="source" placeholder="请输入内容" autocomplete="off" class="layui-input">
                        </div>
                    </div>-->
                    <!--<div class="layui-form-item">
                        <label class="layui-form-label">审核显示</label>
                        <div class="layui-input-block">
                            <input type="checkbox" title="显示" name="open" value="1" checked>
                        </div>
                    </div>-->
                    <!--<div class="layui-form-item">
                        <label class="layui-form-label">推荐精选</label>
                        <div class="layui-input-block">
                            <input type="checkbox" title="推荐" name="commend" value="1" checked>
                            <input type="checkbox" title="精选" name="choice" value="1">
                        </div>
                    </div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">缩略图</label>
                        <div class="layui-input-block">
                            <input type="hidden" name="picture" id="blog-cover"/>
                            <input type="file" name="image" id="blog-cover-file" class="layui-upload-file"/>
                        </div>
                    </div>
                    <div class="layui-form-item" id="cover-preview-cnt">
                        <label class="layui-form-label"></label>
                        <div>
                            <img id="cover-preview-img" class="blog-report-cover"/>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">文章摘要</label>
                        <div class="layui-input-block">
                            <textarea name="summary" required lay-verify="required"  placeholder="请输入内容" class="layui-textarea"></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">文章内容</label>
                        <div class="layui-input-block">
                            <div id="publish-editormd"></div>
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">保存方式</label>
                        <div class="layui-input-block">
                          <select name="status" lay-filter="aihao">
                            <option value=""></option>
                            <option value="0" selected="">发表</option>
                            <option value="1">草稿</option>
                          </select>
                        </div>
                      </div>
                      <div class="layui-form-item">
                        <label class="layui-form-label">文章标签</label>
                        <div class="layui-input-block">
                          <input type="text" name="tags" required lay-verify="required"  placeholder="请输入内容" autocomplete="off" class="layui-input">
                        </div>
                      </div>
                     <hr>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="blogReport">立即提交</button>
                            <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
                        </div>
                    </div>
                </form>
                <script src="${base}/${system}/js/jquery.min.js"></script>
                <script src="${base}/${system}/editor.md/editormd.min.js"></script> 
                <script>
                    layui.config({base:'${base}/${system}/js/'}).use('blog-add');
                </script>
                <script id ="template" type="text/template">
                    <select name="categoryID">
                        {{#  layui.each(d.data, function(index, item){ }}
                        <option value="{{item.id}}">{{item.name}}</option>
                        {{# });}}
                    </select>
                </script>
            </div>
        </div>
    </body>
</html>